<!DOCTYPE html>
<html>
<head>
    <title>Prototype Pattern Example</title>
    <script type="text/javascript">
            
        function hasPrototypeProperty(object, name){
            return !object.hasOwnProperty(name) && (name in object);
        }
            
        function Person(){
        }
        
        Person.prototype.name = "Nicholas";
        Person.prototype.age = 29;
        Person.prototype.job = "Software Engineer";
        Person.prototype.sayName = function(){
            alert(this.name);
        };
        
        var person = new Person();        
        alert(hasPrototypeProperty(person, "name"));  //true
        
        person.name = "Greg";
        alert(hasPrototypeProperty(person, "name"));  //false        

    </script>
</head>
<body>

</body>
</html>